package com.sam.elkdemo.project.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Random;

@Slf4j
@Component
public class ScheduleService {

    @Scheduled(cron = "0 0/1 * * * ?")
    public void randNum() {
        Random random = new Random(200);
        log.info("正常日志" + random.nextInt());
        log.warn("警告日志" + random.nextInt());
        log.error("异常日志" + random.nextInt());
    }
}
